<?php
class starsController extends Controller
{
    function showIndex()
    {
        // TODO: Implement showIndex() method.
    }


    function all()
    {
        $id = $this->_get['id'];
        //每日之星
        $this->putIntoPage("dayStar", $this->modules->UserVote->dayStar($id));
        $this->putIntoPage("dayStars", $this->modules->UserVote->dayStars($id, 15));
        $this->render("front_rqzx");
    }

    function introduce()
    {
        $id = $this->_get['id'];
        $this->putIntoPage("vote", $this->modules->Vote->load($id));
        $this->render("front_dsjs");
    }

    function index()
    {
        $id = $this->_get['id'];
        $this->putIntoPage("vote", $this->modules->Vote->load($id));
        $this->putIntoPage("dayStar", $this->modules->UserVote->dayStar($id));
        $this->putIntoPage("news", $this->modules->News->findByTypeId(6, 9));
        $this->putIntoPage("stars", $this->modules->UserVote->dayStarMore(1, 7));
        $this->putIntoPage("lastApplication", $this->modules->Application->findLast(7));
        $this->render("front_dssy");
    }

    function xuanshous()
    {
        if ($this->_post['keyWord'] != "") {
            $where = " and name like '%" . $this->_post['keyWord'] . "%'";
        }
        $this->putIntoPage("vote", $this->modules->Vote->load(1));
        $pagination_sql = "select * from applications where status = 'PASS' and voteId=1 $where order by createDate desc";
        $pagination_count_sql = "select count(1) as count from applications where status = 'PASS' and voteId=1 $where";
        $this->putIntoPage("pagination", $this->modules->Application->pagination($pagination_sql, $pagination_count_sql));
        $this->render("front_xszs");
    }

    function xuanshou()
    {
        $id = $this->_get['id'];
        $this->putIntoPage("xuanshou", $this->modules->Application->load($id));
        $this->render("front_xxzl");
    }

}

?>